package com.zcup.designer.contribute.simplyabsfactory;

public class Creator {
    public static final String product = "product1";

    //    private static final String product = "product2";
    static AbstractProductA createA() {
        switch (product) {
            case "product1":
                return new ProductA1();
            case "product2":
                return new ProductA2();
            default:
                return null;
        }
    }

    static AbstractProductB createB() {
        switch (product) {
            case "product1":
                return new ProductB1();
            case "product2":
                return new ProductB2();
            default:
                return null;
        }
    }
}
